<?php
namespace Home\Widget;
use Home\Controller\BaseController;
use Home\Core\CommandSDK;
class CateWidget extends BaseController {
    public function header(){
        if(empty(I('get.page'))){
            $param['pageid']=1;
        }else{
            $param['pageid']=$_GET['page'];
        }
        if(empty(I('get.pagecount'))){
            $param['pagecount']=10;
        }else{
            $param['pagecount']=$_GET['pagecount'];
        }
        $sdk = new CommandSDK();
        $return = $this->http_request($sdk::getAreaLists, $param, 'GET');
        $array1 = json_decode(json_encode($return), true);
        $cookie = base64_decode($_COOKIE['user_info']);   // 解析cookie
        parse_str($cookie,$userinfo);
        if($userinfo['userrole']==2){
            $this->assign('array1', $array1);
        }
        $this->assign('userinfo',$userinfo);
      	$this->display('Cate:header'); 
       
    }

    public function left()
    {
        $cookie = base64_decode($_COOKIE['user_info']);   // 解析cookie
        parse_str($cookie,$userinfo);
        $this->assign('userinfo',$userinfo);
        $this->display('Cate:left');
    }


}
